package cn.iocoder.yudao.module.iot.gateway.protocol.custom.xiaoan.tcp.router.handler.message;

import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
import cn.iocoder.yudao.module.iot.gateway.protocol.custom.xiaoan.tcp.codec.XiaoAnCmdTypeEnum;
import io.vertx.core.net.NetSocket;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class LoginHandler implements ResponseHandler {
    @Override
    public boolean supports(String method) {
        return XiaoAnCmdTypeEnum.LOGIN.getCode() == Byte.parseByte(method);
    }

    @Override
    public void handle(NetSocket socket, IotDeviceMessage message, String codecType, String clientId, String serverId) {
        // 处理数据上报消息 响应报文: 无消息体
        log.info("[LoginHandler][处理数据上报，客户端 ID: {}]", clientId);
    }
}
